﻿using System;
using System.Collections;
using RootMotion.FinalIK;
using UnityEngine;

namespace RootMotion.Demos
{
	// Token: 0x020000CB RID: 203
	public class Phone : MonoBehaviour
	{
		// Token: 0x0600060A RID: 1546 RVA: 0x00038024 File Offset: 0x00036224
		public void OnPickUp()
		{
			this.pickUpCollider.enabled = false;
			this.parent = base.transform.parent;
			base.transform.parent = this.pickUpObject.lastUsedInteractionSystem.transform;
			base.GetComponent<Rigidbody>().isKinematic = true;
			base.StartCoroutine(this.EnableDisplay());
		}

		// Token: 0x0600060B RID: 1547 RVA: 0x00038084 File Offset: 0x00036284
		public IEnumerator EnableDisplay()
		{
			yield return new WaitForSeconds(1f);
			this.display.SetActive(true);
			yield break;
		}

		// Token: 0x0600060C RID: 1548 RVA: 0x000028E7 File Offset: 0x00000AE7
		public void OnButton1()
		{
		}

		// Token: 0x0600060D RID: 1549 RVA: 0x00005DFB File Offset: 0x00003FFB
		public void OnButton2()
		{
			this.pickUpObject.lastUsedInteractionSystem.ResumeAll();
			this.pickUpCollider.enabled = true;
			this.display.SetActive(false);
		}

		// Token: 0x0600060E RID: 1550 RVA: 0x00005E25 File Offset: 0x00004025
		public void DropPhone()
		{
			base.transform.parent = this.parent;
			base.GetComponent<Rigidbody>().isKinematic = false;
		}

		// Token: 0x0400051A RID: 1306
		[Tooltip("The collider that is used for triggering the picking up interaction.")]
		public Collider pickUpCollider;

		// Token: 0x0400051B RID: 1307
		[Tooltip("InteractionObject of the picking up interaction.")]
		public InteractionObject pickUpObject;

		// Token: 0x0400051C RID: 1308
		[Tooltip("Root of the phone's display that has all the buttons parented to it.")]
		public GameObject display;

		// Token: 0x0400051D RID: 1309
		public Transform parent;
	}
}
